package com.duowei.diandan.callback;

import android.support.v7.util.DiffUtil;

import com.duowei.diandan.db.entry.Jycssz;

import java.util.List;
import java.util.Objects;

public class DeskChoiceDiffCallback extends DiffUtil.Callback {

    private final List<Jycssz> mOldList;
    private final List<Jycssz> mNewList;

    public DeskChoiceDiffCallback(List<Jycssz> oldList, List<Jycssz> newList) {
        mOldList = oldList;
        mNewList = newList;
    }

    @Override
    public int getOldListSize() {
        return mOldList.size();
    }

    @Override
    public int getNewListSize() {
        return mNewList.size();
    }

    @Override
    public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
        Jycssz oldItem = mOldList.get(oldItemPosition);
        Jycssz newItem = mNewList.get(newItemPosition);

        return Objects.equals(oldItem, newItem);
    }

    @Override
    public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
        return true;
    }
}
